package mop.security.acl;

/**
 * Implementation of RoleInterface to keep in ACL registry
 * @author MOP Team 7
 */
public class Role implements RoleInterface {

	/**
	 * Role ID
	 */
	final String role;
	
	/**
	 * Constructor
	 * @param role	Role id
	 * @post Role id is set to given role
	 * 
	 */
	public Role(String role){
		this.role = role;
	}
	
	/**
	 * Return role id
	 * @see RoleInterface#getRoleId()
	 */
	@Override
	public String getRoleId() {
		return this.role;
	}
	
	/**
	 * @see Object#equals(Object)
	 * @param role	Other role
	 * @return boolean
	 */
	public boolean equals(Object role){
		if(!(role instanceof RoleInterface))
			return false;
		return getRoleId().equals(((RoleInterface) role).getRoleId());
	}

}
